The present invention relates to an image processing apparatus for converting space data described in a language or format that processes a three-dimensional virtual space such as a VRML (Virtual Reality Modeling Language) or the like, into image data that can be stereoscopically observed, and to a viewer apparatus for displaying such image data.
The present invention also relates to a user interface apparatus for changing stereoscopic viewing parameters, a stereoscopic display buffer control method and apparatus for obtaining stereoscopic viewing, and a program storage medium for storing their programs.
As the performance of computers has improved in recent years, three-dimensional computer graphics (CG) has increasingly prevailed. In addition, along with rapid spread of WWWs (World Wide Webs) on the Internet, a VRML as a language that processes a three-dimensional space on the WWW has been standardized, and has been prevalently used.
The VRML 2.0 as the currently available latest version is used for building a virtual mall for electric commerce, managing three-dimensional data of, e.g., CAD in an intranet, and so forth.
On the other hand, the assignee of the present invention has developed a rear-cross lenticular 3D display (to be referred to as a stereoscopic display apparatus hereinafter to be distinguished from a two-dimensional display apparatus) as a stereoscopic display apparatus that allows the observer to directly perceive depth. In addition to this display apparatus, many stereoscopic display apparatuses have been proposed.
In order to display a three-dimensional space described in the VRML 2.0, a VRML viewer apparatus is required. However, a normally prevalent VRML viewer apparatus can only make two-dimensional display (to be referred to as a xe2x80x9ctwo-dimensional display apparatus hereinafter in contrast to the xe2x80x9cstereoscopic display apparatusxe2x80x9d) as final display using a normal monitor, although a three-dimensional space is described.
This is because some parameters (to be referred to as xe2x80x9cstereoscopic viewing parametersxe2x80x9d hereinafter) for attaining stereoscopic viewing are not supported by the VRML 2.0.
In other words, there is no conventional stereoscopic display apparatus that can efficiently change the xe2x80x9cstereoscopic viewing parametersxe2x80x9d in utilizing space data described in the language or format such as VRML that cannot describe the stereoscopic viewing parameters. This is the first problem the conventional stereoscopic display apparatus suffers.
In order to realize stereoscopic viewing on a display, for example, in, e.g., the rear-cross lenticular 3D display proposed by the assignee, right and left images must be alternately written in one frame buffer stripe by stripe.
The problem in the conventional buffer control method will be explained below using the flow chart in FIG. 18.
Conventionally, as shown in the control sequence in FIG. 18, an image to be seen when the three-dimensional space is viewed by the right eye is generated, and three-dimensional space data is rendered on the basis of the viewpoint position and gaze direction of the right eye in step S50. With this process, a right eye image as a rendering result is stored in frame buffer A.
In step S52, an image to be seen when the three-dimensional space is viewed by the left eye is generated, and three-dimensional space data is rendered on the basis of the viewpoint position and gaze direction of the left eye. As a result, a left eye image as a rendering result is stored in frame buffer B.
In step S54, frame buffer C is prepared, and data required for right eye display is read out from the contents of frame buffer A and is written in frame buffer C.
In step S56, data required for left eye display is read out from the contents of frame buffer B and is written in frame buffer C. In this manner, the buffer control method shown in FIG. 18 requires three buffers.
FIG. 19 shows a buffer write control sequence according to another prior art. The buffer control method shown in FIG. 19 requires two buffers.
In this fashion, both the methods shown in FIGS. 18 and 19 require two or more frame buffers, and are disadvantageous in cost.
Also, inter-buffer data transfer that requires processing for reading out data from a frame buffer in which the data has been written, and writing the data in another frame buffer is time-consuming processing, and lowers the processing speed.
The present invention has been made in consideration of the conventional problems, and has as its object to provide a stereoscopic image processing apparatus, user interface apparatus, and stereoscopic image display apparatus, which can assign parameters to three-dimensional space data in which stereoscopic viewing parameters are not defined.
It is another object of the present invention to provide a user interface apparatus which can freely change the stereoscopic viewing parameters.
It is still another object of the present invention to provide a buffer control apparatus and method, which requires only one frame buffer, and can obviate the need for reading out any data from that frame buffer.
In order to achieve the above object, a stereoscopic image processing apparatus according to the present invention comprises:
means for receiving and storing three-dimensional space data; and
means for generating a parameter required for stereoscopic viewing on the basis of the received three-dimensional space data.
According to a preferred aspect of the present invention, the parameter defines a base line length of a user. Also, according to a preferred aspect of the present invention, the parameter defines a convergence angle of a user. The base line length and convergence angle are mandatory parameters required to realize stereoscopic viewing.
Since the user often does not know that an input three-dimensional space data requires parameter setup, it is preferable to automatically set parameters. Hence, according to a preferred aspect of the present invention, the apparatus further comprises means for determining necessity of generation of the parameter on the basis of a file extension of the received three-dimensional space data or attribute information appended the data file.
According to the present invention, a user interface apparatus used upon displaying a stereoscopic image, comprises:
user setting means for allowing a user to set a value of a stereoscopic viewing parameter; and
means for changing a value of the stereoscopic viewing parameter in accordance with the set value.
With this user interface apparatus, the parameters can be freely changed to match image data with the purpose of the user""s application.
The user interface is preferably displayed on the display screen. According to a preferred aspect of the present invention, the apparatus further comprises display means, and the user setting means displays a GUI on the display means.
According to a preferred aspect of the present invention, the GUI is implemented by a slide bar, jog dial or wheel.
A buffer control method for effectively using a buffer according to the present invention is directed to a buffer control method upon obtaining stereoscopic viewing by displaying right and left eye images written in one frame buffer, comprising the steps of:
preparing mask information that defines a mask function in advance;
writing one of the right and left eye images in the frame buffer; and
overwriting the other image on the frame buffer with reference to the mask information. Upon overwrite, a portion of one image is left and a portion of the other image is overwritten on the frame buffer in accordance with the mask function of the mask information.
The above objects are also achieved by a buffer control apparatus which has one frame buffer and obtains stereoscopic viewing by displaying right and left eye images written in the frame buffer, comprising:
a mask memory written with mask information that defines a mask function in advance; and
control means for writing one of the right and left eye images in the frame buffer, and then overwriting the other image on the frame buffer with reference to the mask information in the mask memory.
In this case, according to a preferred aspect of the present invention, the mask memory comprises a stencil buffer.
In the control method according to a preferred aspect of the present invention, the mask function is determined based on an order of stripes on a display apparatus, and a write order of images in the frame buffer.
In the control method according to a preferred aspect of the present invention, the mask information is written in a stencil buffer at least before the other image is written in the frame memory.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.